<!DOCTYPE html>
<html lang="en">

<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
   <title>bootstrap</title>
  <!-- <script>
     alert('美少女战士')
  </script> -->
   <!-- <script src="liu.js"></script> -->
    <!-- // prompt('你是猪');
    // alert('我是美女');
    // console.log('我是程序员，可以看');
    // var myname = 'liumingyue';
    // var age = 20;
    // console.log(age);
    // console.log(myname);
   /* var myname = prompt('你的名字');
    alert(myname); */ 
   //  var myname = 'liu';
    /* age = 18;
    address = '地球'
    console.log('myname');
    var age = 18;
    console.log(isNaN(age)); */
   //  var year = prompt('请输入');
    /* var age = 2024 - year;
alert('你今年' + age + '岁了');
    */
    /*  var num1 = prompt('请输入你的第一个值');
    var num2 = prompt('请输入你的第二个值');
    var result = parseFloat(num1) + parseFloat(num2);
    alert ('结果:' + result);*/
    /* var num = 8;
    var str = '我是刘美女';
    console.log(num>6&&str.length>3); */
    /* var num =3;
    var str = 'liumingyue';
    console.log(num>3||str.length<2); */
    /* var num = prompt('输入次数');
    for(num=1;num<100;num++){
      console.log('你好吗');
    var sum = 0;
    var average = 0;
    for(var i =1;i<=100;i++){
      sum=sum+i;
    }
    average=sum/100;
    console.log(average);
    alert(average); */
    /* /var num = prompt('输入班级的总人数');
    var sum = 0;
    var average = 0;
    for(var i =1;i<=num;i++){
      var score = prompt('输入第'+ i 
      +'个学生成绩');
      sum=sum+parseFloat(score);
    }
    average=sum/num;
    alert('总成绩' + sum);
    alert('班级平均分' + average);  */
   /* var str = '';
    for(var i=1;i<=3;i++){
      str=str+'♥';
    }
console.log(str); */ 
/* var str='';
for(var i=1;i<=5;i++){
   for(var j=1;j<=5;j++){
      str =str+'♥';
   }
   str = str+'\n';
}
console.log(str); */
/* ar rows = prompt('请你输入行数');
var cols = prompt('请你输入列数');
var str='';
for(var rows=1;rows<=5;rows++){
   for(var cols=1;cols<=5;cols++){
      str =str+'♥';
   }
   str = str+'\n';
}
console.log(str); 
alert(str); */
/*  var str ='♥';
for(var i=1;i<=10;i++){
   for(var j =i;j<=10;j++){
      str = str+'♥';
   }
   str=str +'\n';
}
// console.log(str);打赢倒三角*/
/*  var str ='';
for(var i=1;i<=9;i++){
   for(var j=1;j<=i;j++){
      str+=j+'*'+i+'='+i*j+'\t';
   }
   str+='\n';
}
console.log(str);九九乘法表（正三角）*/
/* var arr = [2,6,1,7,4];
var sum = 0;
var average = 0;
for(var i = 0;i<arr.length;i++){
   sum += a[i];
}
average = sum / arr.length;
console.log(sum,average);
alert(sum,average); */
/* function cook(aru) {
   console.log(aru);
}
cook('土豆丝');函数调用 */
/* function getsum(num1,num2){
   console.log(num1+num2);
}
getsum(6,3); */
/* function  sum(n1,n2) {
   console.log(n1+n2);
}
sum(1); */
/* function getsum(num1,num2) {
   return(num1+num2);
}
console.log(getsum(1,5));函数返回值 */
/*function  getArrayMax(arr) {
   var Max = a[0];
   for(var i = 1; i<= arr.length;i++){
      if(a[i] > Max){
      Max = a[i];
      }
   }
   return Max;
}
var re = getArrayMax([1,2,3,4,5,6]);
console.log(re);求函数最大值  */
/* function sort(arr) {
   for(var i=0;i<arr.length;i++){
      for (var j=0;j<arr.length-i-1;j++){
         if (arr[j]>arr[j+1]) {
            var temp = arr[j];
            arr[j] = arr[j+1];
            arr[j+1] = temp;
         }
      }
         
      }
      return arr;
   }
var arr1 = sort([1,2,3,4,5]);
console.log(arr1);冒泡排序 */
/* function isRunyear(year) {
   var flag = false;
   if(year%4==0&&year%100!=0||year%400==0){
      flag = true;
   }
   return flag;
}
console.log(isRunyear(2000));判断是否是闰年 */
/* function backday() {
   var year = prompt('输入年份');
   if(isRunyear(year)){
      alert('29天');
   }
   else{
      alert('28天');
   }

}
backday();
function  isRunyear(year) {
   var flag = false;
   if(year%4==0&&year%100!=0||year%400==0){
      flag = true;
   }
   else{
     return flag;
   }
} */
/*var num =10;
function fn() {
   console.log(num);
   var num = 20;
   console.log(num);
}
fn();

/**相当于
 * var num;
 * function fn(){
 * var num;
 * console.log(num);undefined
 * num = 20;
 * console.log(num);20
 * }
 * num = 10;
fn();  */

/* function  Star(uname,age) {
   this.name = uame;
   this.age = age;
   this.sing = function (sang) {
      console.log(sang);
   }
}
var lmy = new Star('刘明月',20);
console.log(lmy.umame);
console.log(lmy['age']);
lmy.sing('冰雨');*构造函数创建对象/
*/
/*  var date = new date();
console.log(date.getfullyear());
console.log(date.getMath() + 1);
console.log(date.getDate());//返回几号
console.log(date.getDay());//返回星期几*/
/* var date = new Date("2023-1-1");
var year = date.getFullYear();
var month = date.getMonth() + 1;
var dates = date.getDate();
var arr = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
var day = date.getDay();
console.log('今天是' + year + '年' + month + '月' + dates + '日');
*/
/*  var date = new Date();
console.log(date.valueOf());
console.log(date.getTime());//返回总的时间
//最常用写法
console.log(Date.now());*/
/*  function countDom(time) {
   var nowTime = +new Date();
   var inputTime = +new Date(time);
   var times = (inputTime-nowTime)/1000;
   var d = parseInt(times/60/60/24);
   d = d<10?'0' + d : d;
   var h = parseInt(times/60/60%24);
   h = h<10?'0' + h : h;
   var m = parseInt(times/60%60);
   m = m<10?'0' + h : h;
   var s = parseInt(times%60);
   s = s<10?'0' + s : s;
return d + '天' + h + '时' + m + '分' + s +'秒';
}
console.log(countDom('2019-5-1 18:00:00'));
var date = new Date();
console.log(date);*///这两行代码创建一个新的 Date 对象（表示当前日期和时间），并将其打印到控制台。

/*  var arr1 = [1,2,3];
console.log(arr[0]);//字面量
var arr1 = new Array();
var arr1 = new Array(2,3);
console.log(arr1);//new array()创建*/

/*  //检查是否为数组
var arr = [];
var obj = {};
//console.log(arr instanceof Array);
//console.log(obj instanceof Array);//
//法2
console.log(Array.isArray(arr));
console.log(Array.isArray(obj));*/

/* var arr = [1,2,3];
//push(a,'lmy');
console.log(arr.push(4,'lmy'));//1后添加

var arr = [1,2,3]; */
/* //删除元素
var arr = [1,2,3];
//console.log(arr.pop());//尾部删除
console.log(arr.shift());//2.前删除 */
/*  var arr1 = [3,4,7,1];
arr.sort(function(a,b) {
   return a-b;
})
console.log(arr1);*/

/* function unique(arr) {
   var newArr = [];
for (var i = 0;i<array.length;i++) {
  if(newArr.indexOf(arr[i])==-1){
   newArr.push(arr[i]);
  }
   
}
return newArr;
}
var demo = unique(['1','2','3']);
var demo = unique(['8','4','3']);
console.log(demo);数组去重 */

/*  var arr1 = ['pink' , 'blue' ,'yellow'];
//console.log(arr1.join());
//console.log(arr1.join('-'));
console.log(arr1.join('&'));数组转化为字符串*/

/* var temp = new String('andy');
str = temp;
temp = null;(基本包装类型) */

/*  var str = 'a,b,c,d,e,f,o,s,d,u,b,o,c,f,h,o,c,s,b,o,v,o,o';
var index = str.indexOf('o');
var num = 0;
while(index!=-1){
   console.log(index);
   num++;
   index = str.indexOf('o',index + 1);
}
console.log('o出现的次数是:' + num);*/
 
/* var str = 'andy';
console.log(str.charAt(3));
//遍历所有数组
for (var i= 0;i<str.length;i++){
   console.log(str.charAt(i));
}
console.log(str.charCodeAt(0));
console.log(str[2]); */

/* 统计出现最多的字符和字符个数 var str = ['q','y','t','u','q','y'];
var o = {};
for(var i= 0;i<str.length;i++){
   var chars = str.charAt(i);
   if(o[chars]){
      o[chars]++;
   }
   else{
      o[chars] = 1;
   }
}
console.log(o);*/

/* var str = 'andy';
console.log(str.concat('red'));连接字符串 */
/* var str = '刘明月是美女';
console.log(str.substr(2,3));截取字符串*/

/* var str = 'pi,ji,uu';
console.log(str.replace('pi','liu'));字符替换*/

/*字符串转化为数组
 var str = 'oo,pp,qq';
console.log(str.split('&'));//,有区别 */ --> 
    
<style>
   /*//img {
      width: 300px;
   }  */
   /* .box {
      position: relative;
      width: 400px;
      border-bottom: 1px solid #ccc;
      margin: 100px auto;
   }
   .box input {
      width: 370px;
      height: 30px;
      border: 0;
      outline: none;
   }
   .box img {
      position: absolute;
      width: 24px;
      top: 2px;
      right: 2px;
   } .change {
color: aquamarine;
   }*/
   
   .ipt {
      background-color: #ccc;
   }
   .message {
      display: inline-block;
      font-size: 12px;
      color: #999;
      background: url('images/京东.png') no-repeat left center;
      padding-left: .5333rem;
   }
   .wrong {
      color: red;
      background-image: url('images/潮图.JPG');
   }
   .right {
      color: greenyellow;
      background: url('images/京东.png') no-repeat;
   }
</style>

</head>

<body>
<!-- <input type="botton" value="刘明月" onclick="alert('爱吃番茄蛋')"> -->
<!-- <div id="time">刘明月是美女</div>//通过id获取元素
<script>
   var timer = document.getElementById('time');
   console.log(timer);
   console.log(typeof timer);//对象
   console.dir(timer);//看属性和方法
</script> -->

<!--<ol> 
   <li>ggg</li>
   <li>🤟</li>
   <li>么么哒</li> -->
<!-- </ol> -->
 <!-- var lis = document.getElementsByTagName('li');
   console.log(lis);*//* var ol = document.getElementById('ol');
   console.log(ol.getElementsByTagName('li')); -->

   <!--  </script>  -->
<!-- 新增h5获取元素 <div class="box">ggg</div>
<div class="box">iii</div>
<div class="box">nnn</div>
<script>
var boxs = document.getElementsByClassName('box');
console.log(boxs);
var allboxs = document.querySelectorAll('.box');-->

<!--<button id="btn">刘明月</button>
<script> btn = document.getElementById('btn');
btn.onclick = function() {
   alert('是美女');
}事件基础  -->

<!--<div></div>
<p>
   jjj金鸡奖
   <span>123</span>
</p>  -->
<!--<div>上午好</div>
<img src = "images\京东.png" alt="">  -->
<!--<button>啦啦啦</button>
<input type="text" value = 'lll零零零零'>  -->
<!-- <div class="box">
   <lable for="">
      <img src="images/潮图.JPG" alt="" id="ey">
   </lable>
   <input type="password" name="" id="pwd">
</div> -->
<!--<input type="text" value="手机">
<div class="first">文本</div>  -->
<!--<div class="rejister">
   <input type="password " class="ipt">
   <input type="text" value="手机">
</div>  -->
<!-- <div id="demo" index="1" class="nav"></div> -->
<script>
   //div.innerText = '<strong>今天是 <strong> 2019';
   //var div = document.querySelector('div');
   //console.log(div.innerText);
   /*  div.innerHtml = '<strong>今天是 <strong> 2019';
      var p = document.querySelector('p');
   console.log(p.innerHtml);*/
/*  var img = document.querySelector('img');
var div = document.querySelector('div');
var date = new Date();
var h = date.getHours();
if(h<12) {
   img.src = "images\潮图.JPG";
   div.innerHTML = '亲上午好，好好写代码';
}else if(h <18) {
   img.src = "images\京东.png";
   div.innerHTML = '亲xia午好,好好写代码';
}else {
   img.src = "images\我的域名.png";
   div.innerHTML = '亲晚上好，好好写代码';
}
*/
/* var btn = document.querySelector('button');
var input = document.querySelector('input');
btn.onclick = function () {
   input.value = '被点击了';
   this.disabled = 'true';
} */
//1.获取元素
/* var ey = document.querySelector('ey');
var pwd = document.querySelector('pwd');
//2组测时间
var flag = 0;
eye.onclick = function () {
   if(flag==0){
      pwd.type='text';
      ey.src = 'images/京东.png';
      flag = 1;
   }
   else {
      pwd.type = 'password';
      ey.src = 'images/潮图.JPG';
      flag = 0;
   }
} */
/*var text = document.querySelector('input');
text.onfocus = function () {
   if(this.value=='手机'){
      this.value = '';
   }
   this.style.color = '#333';
}
text.onblur = function() {
   if(this.value = ''){
      this.value='手机';
   }
   this.style.color='#999';
}  */
/* /var test = document.querySelector('div');
test.onclick = function () {
   this.className = 'first change'; *
}/*var ipt = document.querySelector('ipt');
var message = document.querySelector('.message');
ipt.onblur = function() {
   if(this.value.length<6||this.value.length>16){
      message.className = 'message wrong';
      message.innerHTML = '你输入位数有';
   }
   else{
      message.className = 'message right';
      message.innerHTML = '刘明月正确啦';
   }
}  */
  /* var buttons = document.getElementsByTagName('button');
for(var i = 0;i<btns.length;i++){
   btns[i].onclick = function () {
      for(var i=0;i<btns.length;i++){
         btns[i].style.backgroundColor = '';
      }
      this.style.backgroundColor = 'pink';
   }
} */
/*  属性自定义操作
var div = document.querySelector('div');
console.log(div.id);
console.log(div.getAttribute('id'));
console.log(div.getAttribute('index'));
//2.
div.id = 'test';
div.className ='navs';
div.setAttribute('index',2);
div.setAttribute('class','footer');
//3.
div.removeAttribute('index');*/
</script>


</body>
</html>